package design.factory.simple;

//消费者
public class Consumer {
    public static void main(String[] args) {
        //普通写法，获取车
        WuLing wuLing = new WuLing();
        Tesla tesla = new Tesla();
        System.out.println("普通方式获取车============");
        wuLing.name();
        tesla.name();

        //通过工厂来获取车——静态工厂模式
        Car car = CarFactory.getCar("五菱");
        Car car1 = CarFactory.getCar("特斯拉");
        System.out.println("工厂模式获取车============");
        car.name();
        car1.name();

    }
}
